A conventional motor control device is explained using FIG. 8. FIG. 8 is a block diagram of a motor control device having a means for switching from a velocity loop to a position loop.
In FIG. 8, a motor control device 1 comprises: an instruction-generating unit consisting of a position-instruction generator 2 and a velocity-instruction generator 4 for generating a position-instruction signal θr for a motor 18 and a velocity-instruction signal Vrv for the motor 18 respectively; a detection unit for detecting a position-detection signal θs and a velocity-detection signal Vs for the motor 18; a switch unit for switching control of the motor 18 from the velocity loop to the position loop; and a control unit for controlling the motor 18 based on e.g. position deviation θe that is equal to the difference between the position-instruction signal θr and the position-detection signal θs.
The detection unit comprises an encoder 20 for detecting the position-detection signal θs as the rotational position of the motor 18, and a velocity-detection unit 22 for generating the velocity-detection signal Vs from the position-detection signal θs having been inputted.
The switch unit switches between an output terminal “a” of the velocity-instruction generator 4 and an output terminal “b” of a position-control device 8, and comprises a switch SWv of which a terminal “c” is connected to a subtraction unit 10, and a switch SWp that is connected to an output of the position-instruction generator 2 and an input of a subtraction unit 6.
The control unit comprises: the subtraction unit 6 for calculating the position-deviation θe that is equal to the difference between the position-detection signal θs and the position-instruction signal θr; the position-control device 8 generating a velocity-instruction Vr based on the position-deviation θe having been inputted, and having a position-gain Kp; the subtraction unit 10 for calculating a velocity-deviation Ve that is equal to the difference between the velocity-instruction signal Vr (Vrv) and the velocity-detection signal Vs; a velocity-control unit 12 generating a current-instruction signal Ir based on the velocity-deviation Ve having been inputted; a current limiting unit 15 outputting a limited current-instruction signal IrL when the current-instruction signal Ir having been inputted exceeds a predetermined current value IrL; and a current control unit 16 supplying to the motor 18 a current based on the current-instruction signal IrL.
Here, the current-instruction signal Ir is limited by the current limiting unit 15 so that the motor 18 will have constant output-power characteristics. The reason for having constant output-power characteristics is that since the motor 18, which is used for example on the main axle of a numerical control machine tool, reaches tens of thousands of rpm, and the output power would be enormous if it has constant torque characteristics, and therefore it is made to have constant output-power characteristics after several thousand rpm.
The motor control device 1 constituted as explained above, in opening the switch SWp before the motor starts running and throwing on the switch SWv to the terminal “a” side, inputs into the subtraction unit 10 the velocity-instruction signal Vrv, which is issued from the velocity-instruction generator 4 based on a start-operation instruction, whereby the subtraction unit 10 calculates the velocity-deviation Ve that is equal to the difference between the velocity-instruction signal Vrv and the velocity-detection signal Vs, wherein the motor control device 1 controls the motor 18 velocity based on the velocity-deviation Ve.
Then, when the motor 18 transitions from constant speed to speed-reduction state, the switch SWp is closed from being open, reducing the speed of the motor 18 to a predetermined speed, and after the velocity-instruction signal Vrv from the velocity-instruction generator 4 has been confirmed consistent with the velocity-instruction signal Vr from position-control device 8 while the motor is running at a constant low speed, the switch SWv is thrown from the terminal “a” to the terminal “b,” whereby the motor 18 is controlled according to the position loop based on the velocity-instruction signal Vr.
However, although control in the motor control device 1 is switched over from velocity loop to position loop as aforesaid, there have been problems in that control of e.g. timing when the switch SWv is thrown from the terminal “a” to the terminal “b” is complicated.
In order to solve such problems, although opening the switch SWp before the motor 18 starts running, and driving it only by the position-instruction signal θr from the position-instruction generator 2 by throwing the switch SWv to the terminal “b” is conceivable, there would be a problem that the acceleration of the motor 18 would overshoot, because the position-deviation θe would widen when the current limiter 15 functions and the motor 18 acceleration drops, and when the current limitation by the current limiter 15 is then released, the motor 18 would operate based on the large position-deviation θe.